#include <adjacency_list.hpp>
Classes | |
struct | p_Edge |
Public Types | |
typedef unsigned int | Index |
In case we need to change the type. | |
typedef std::vector< Index > | IndexVector |
A thing to hold Indexes. | |
Public Member Functions | |
AdjacencyList (const parallel::Communicator &comm) | |
Default constructor. | |
AdjacencyList (const parallel::Communicator &comm, const int &local_nodes, const int &local_edges) | |
Construct with known local sizes (guesses to size containers, maybe). | |
~AdjacencyList (void) | |
Destructor. | |
void | add_node (const Index &global_index, const Index &original_index) |
Add the global index and original index of a local node. | |
void | add_edge (const Index &edge_index, Index node_index_1, Index node_index_2) |
void | get_global_edge_ids (int idx, Index *node_index_1, Index *node_index_2) const |
Get the global indices of the buses at either end of a branch. | |
size_t | nodes (void) const |
Get the number of local nodes. | |
Index | node_index (const int &local_index) const |
Get the global node index given a local index. | |
size_t | edges (void) const |
Get the number of local edges. | |
Index | edge_index (const int &local_index) const |
Get the global edge index given a local index. | |
void | edge (const int &local_index, Index &node1, Index &node2) const |
Get an edges connected global node indexes. | |
void | ready (void) |
Indicate that the graph is complete. | |
void | node_neighbors (const int &local_index, IndexVector &global_neighbor_indexes) const |
Get the neighbors of the specified (local) node. | |
size_t | node_neighbors (const int &local_index) const |
Get the number of neighbors of the specified (local) node. | |
Static Public Attributes | |
static const Index | bogus |
The index that means unconnected. |
This class provides a way to assemble a graph adjacency list when graph node and edge information is arbitrarily distributed. For example, one process may "own" a certain node, but the way that node is connected to others may be on another process.
It just works with integral indexes. It is assumed that the global indexes start with 0, are unique, and that the largest index is N-1 if there are N nodes/edges. There's probably some special term for that.
typedef unsigned int gridpack::network::AdjacencyList::Index |
In case we need to change the type.
typedef std::vector<Index> gridpack::network::AdjacencyList::IndexVector |
A thing to hold Indexes.
gridpack::network::AdjacencyList::AdjacencyList | ( | const parallel::Communicator & | comm | ) |
Default constructor.
gridpack::network::AdjacencyList::AdjacencyList | ( | const parallel::Communicator & | comm, | |
const int & | local_nodes, | |||
const int & | local_edges | |||
) |
Construct with known local sizes (guesses to size containers, maybe).
gridpack::network::AdjacencyList::~AdjacencyList | ( | void | ) |
Destructor.
void gridpack::network::AdjacencyList::add_edge | ( | const Index & | edge_index, | |
Index | node_index_1, | |||
Index | node_index_2 | |||
) |
Add the global index of a local edge and what it connects using the original indices for the buses at either end of the node
void gridpack::network::AdjacencyList::add_node | ( | const Index & | global_index, | |
const Index & | original_index | |||
) |
Add the global index and original index of a local node.
void gridpack::network::AdjacencyList::edge | ( | const int & | local_index, | |
Index & | node1, | |||
Index & | node2 | |||
) | const |
Get an edges connected global node indexes.
Index gridpack::network::AdjacencyList::edge_index | ( | const int & | local_index | ) | const |
Get the global edge index given a local index.
size_t gridpack::network::AdjacencyList::edges | ( | void | ) | const |
Get the number of local edges.
void gridpack::network::AdjacencyList::get_global_edge_ids | ( | int | idx, | |
Index * | node_index_1, | |||
Index * | node_index_2 | |||
) | const |
Get the global indices of the buses at either end of a branch.
Index gridpack::network::AdjacencyList::node_index | ( | const int & | local_index | ) | const |
Get the global node index given a local index.
size_t gridpack::network::AdjacencyList::node_neighbors | ( | const int & | local_index | ) | const |
Get the number of neighbors of the specified (local) node.
void gridpack::network::AdjacencyList::node_neighbors | ( | const int & | local_index, | |
IndexVector & | global_neighbor_indexes | |||
) | const |
Get the neighbors of the specified (local) node.
size_t gridpack::network::AdjacencyList::nodes | ( | void | ) | const |
Get the number of local nodes.
void gridpack::network::AdjacencyList::ready | ( | void | ) |
Indicate that the graph is complete.
const Index gridpack::network::AdjacencyList::bogus [static] |
The index that means unconnected.